from cold_start_analyzer.base_analyzer import BaseAnalyzer
from cold_start_analyzer.consts import NOT_AVAILABLE

class Phase1TPEvent(BaseAnalyzer):
    description = "Touch事件分发到桌面: 从第一个Touch事件到SceneSession接受Touch事件"
    def get_result(self):
        """
        起点： 第一个 touch event
        H:touchEventDispatch
        终点： touch_test
        """
        if 'Phase1All' not in self.context:
            return NOT_AVAILABLE
        return self.context['Phase1All']['touch_test'] - self.context['Phase1All']['first_touch']
